package com.platform.hospital.wx.controller;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * @author yyh
 *
 * @date 2018/02/05
 *
 * @description 信息controller
 */
@Controller
@RequestMapping("/info/")
public class InfoWebController {


    private static final Logger logger = LoggerFactory.getLogger(InfoWebController.class);

    /**
     * 信息列表
     * @param infoType
     * @return
     */
    @RequestMapping("/{infoType}/list")
    public String doctorList(@PathVariable String infoType){
        logger.debug("--------doctorList "+infoType+" start---------");
        return "/info/"+infoType+"List";
    }


    /**
     * 信息详情
     * @param infoId
     * @return
     */
    @RequestMapping("/{infoId}/{infoType}/detail")
    public String detail(@PathVariable Long infoId, @PathVariable String infoType, Model m){
        if(StringUtils.isEmpty(infoId)){

        }
        logger.debug("--------detail start---------");
        m.addAttribute("infoType",infoType);
        return "/info/detail";
    }

    /**
     * 来院导航
     * @return
     */
    @RequestMapping("/navigation")
    public String navigation(){
        logger.debug("--------navigation start---------");
        return "/info/navigation";
    }
}
